package br.com.bestOffer.soquete.bean;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import br.com.bestOffer.ejb.componentes.entity.Soquete;
import br.com.bestOffer.ejb.serviceBean.SoqueteServiceBean;
import br.com.bestOffer.exceptions.BestOfferListaVaziaException;

@ManagedBean
@ViewScoped
public class ListarSoqueteManagedBean {

	private List<Soquete> listaSoquete = new ArrayList<Soquete>();
	
	@EJB
	private SoqueteServiceBean soqueteServiceBean;
	
	@PostConstruct
	public void init() throws BestOfferListaVaziaException{
		listaSoquete = soqueteServiceBean.listarSoquetes();
	}

	public List<Soquete> getListaSoquete() {
		return listaSoquete;
	}

	public void setListaSoquete(List<Soquete> listaSoquete) {
		this.listaSoquete = listaSoquete;
	}

	public SoqueteServiceBean getSoqueteServiceBean() {
		return soqueteServiceBean;
	}

	public void setSoqueteServiceBean(SoqueteServiceBean soqueteServiceBean) {
		this.soqueteServiceBean = soqueteServiceBean;
	}
	
	
	
	
}
